package com.yanqu.road.server.cmd.player;

import com.yanqu.road.pb.house.HouseProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.player.HouseModule;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;
import com.yanqu.road.server.command.Cmd;

@Cmd(code = Protocol.S_HOUSE_UPGRADE, desc = "钱庄升级")
public class HouseUpgradeCmd extends AbstractCommand {


	@Override
	public boolean parseData(YanQuMessage packet) throws Exception {
		return true;
	}

	@Override
	public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
		ret = player.getModule(HouseModule.class).houseUpgrade();
	}

	@Override
	public void sendData(GamePlayer player) {
		HouseProto.HouseUpgradeRespMsg.Builder respMsg = HouseProto.HouseUpgradeRespMsg.newBuilder();
		respMsg.setRet(ret);
		player.sendPacket(Protocol.U_HOUSE_UPGRADE, respMsg);
	}
}
